#pragma once
#include <fstream>
#include<iostream>
#include<sstream>
#include <string>
#include <vector>
using namespace std;

vector<vector<double>> foperate()
{
	ifstream ifs;
	string line, word;
	double a = 0, b = 0;
	int N;
	double len; // len = (b - a) / (N - 1)
	vector<double> vec;
	vector<vector<double>> vec2;
	ifs.open("parameters.txt", ios::in);
	//i is the number of rows
	for (int i = 1; getline(ifs, line); i++)
	{
		if (i % 2 == 1)
		{
			istringstream ss(line);
			ss >> a;
			ss >> b;
		}
		if (i % 2 == 0)
		{
			istringstream ss(line);
			while (ss >> N)
			{
				len = (b - a) / (N - 1);
				for (int k = 1; k <= N; k++)
				{
					vec.push_back(a + (k - 1) * len);
				}
				vec2.push_back(vec);
				vec = {};
			}
		}
		
	}

	return vec2;
}